<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:component>
	<s:div styleClass="title">
		<h2><h:outputText value="#{messages['title.before.you.go']}" /></h2>
		<h:outputText value="#{messages['subtitle.objava']}" />
		<ctg:nbsp />
		<s:link action="#{objavaAction.addSetup(param.back)}"
			value="#{messages['label.add_new_information']}" propagation="none" styleClass="special1">
			<f:param name="back" value="#{back}" />
		</s:link>
		<ctg:nbsp />
		<h:outputText value="#{messages['label.add_new_information_part2']}" />
	</s:div>
	<f:subview rendered="#{objaveForPanel.rowCount == 0}">
		<br />
	</f:subview>
	<rich:panel id="objave" styleClass="green-panel no-border" rendered="#{objaveForPanel.rowCount > 0}">
		<rich:dataGrid columns="3" elements="6" value="#{objaveForPanel}"
			rendered="#{objaveForPanel.rowCount > 0}" width="95%" var="o"
			columnClasses="text11">
			<h4><h:outputText
				value="#{messages[stringUtil.merge('label.tip_objave.',o.tipObjave.idTipaObjave)]}" /></h4>
			<h3><h:outputLink value="http://#{o.www}" styleClass="pnlObjave">
				<h:outputText value="#{o.naslov}" />
			</h:outputLink></h3>
			<h:outputText value="#{o.stranica}" styleClass="site" />
			<p><h:outputText value="#{stringUtil.substring(o.tekst, 50)}" />
			<h:outputLink value="http://#{o.www}" styleClass="pnlObjave">
				<h:outputText value="#{messages['label.link.more']}"></h:outputText>
			</h:outputLink></p>
		</rich:dataGrid>
		<s:div
			rendered="#{value.size > 6 or (identity.hasRole('1') == true and objaveForPanel.size > 0)}">
			<s:link view="/guides/objave/list.xhtml"
				value="#{messages['label.read.all']}" propagation="none"
				rendered="#{param.idObjekta != null}" />
			<s:link view="/guides/mjesta/objave.xhtml"
				value="#{messages['label.read.all']}" propagation="none"
				rendered="#{param.idMjesta != null}" />
			<s:link view="/guides/otoci/objave.xhtml"
				value="#{messages['label.read.all']}" propagation="none"
				rendered="#{param.idOtoka != null}" />
			<s:link view="/guides/parkovi/objave.xhtml"
				value="#{messages['label.read.all']}" propagation="none"
				rendered="#{param.idParka != null}" />
		</s:div>
	</rich:panel>

	<script type="text/javascript">
	 jQuery(function() {	 
		 jQuery('a.pnlObjave').click(function() {
			new Boxy('<iframe frameborder="0" marginheight="0" marginwidth="0" class="loading" src="' + this.href + '">Test</iframe>',{title:'#{messages['subtitle.objava']}'}).resize(900,700);
			return false; 
		 });
	 });
	</script>

</ui:component>

</html>